home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
str.exe
/
README
< prev
next >
Wrap
Text File
|
1993-04-13
|
10KB
|
240 lines
Copyright (c) 1993 by Roy S. Woll
Class "str", Version 2.1 3/1/93
You may distribute and sell any executable which results from using this code
in your applications. You may redistribute this source freely as long as you
leave all files in their original form, including the copyright notice as is.
You may NOT include any SOURCE code of this software with any program that is
sold.
I would sincerely welcome any comments/criticism/ideas you might have about
the str or the regular expression class.
If you use the product, please register by sending $15.00 to
Roy S. Woll, 1032 Summerplace Dr., San Jose, CA 95122. You will receive
an enhanced version of the class, more extensive documentation,
and updates as they are made available.
------------------------------------------
| |
| Roy S. Woll |
| 1032 Summerplace Dr. |
| San Jose, CA 95122 |
| |
| CompuServe : 76207,2541 |
| |
| Phone: (408) 778-2000 x4518 (day) |
| (408) 293-5893 (evening) |
| |
------------------------------------------
In addition those of you who register will receive a more powerful
version of the regular expression class that includes context-sensitive
regular expressions. For instance you will easily be able to search or
replace a specific portion (flagged by '@') of a regular expression.
regX employeeX("Pay to the order of @[A-Za-z\\s]+$");
str paycheck("Payroll\nPay to the order of Roy S. Woll\n$50,000");
str employee;
paycheck.search(employeeX, &employee);
paycheck.replace(employeeX, "a lucky person");
//
// After executing the above code, employee will contain the
// name of the person following the text "Pay to the order of ".
//
// employee = "Roy S. Woll"
// paycheck = "Payroll\nPay to the order of lucky person\n$50,000"
//
------------------------------------------------------------------------------
FILES: THE FOLLOWING FILES ARE INCLUDED.
str.doc Documentation file for str class.
str.h Interface file for str class
regX.h Interface file for regular expression class
regXimp.h Interface file used only for implementation of regX
dynstream.h Interface file for dynstream class
bcstr.h Interface file for BCstr class. BCstr is compatible
with the Borland object-based container classes.
It is derived from str.
str.cpp Implementation file for str class
regX.cpp Implementation file for regular expression class
dynstream.cpp Implementation file for dynstream class
match.cpp Regular expression compiling and searching routines
strsearch.cpp Member functions relating to search/replace
bcstr.cpp Implementation file for BCstr class
strcmp.cpp Non-ansi string routines used by str class. Add
this to your library if your system does not have
these (stricmp, strnicmp, strupr, strlwr).
grep.cpp Demo program for "str" class, supporting
file searching of regular expression matches.
Supports wildcard file specifications, case
sensitivity, line numbers, etc.)
makefile This program defines how to build str.lib
readme Brief overview
------------------------------------------------------------------------------
INSTALLATION AND USE:
---------------------
STR.LIB
-------
Type "make" to compile the source and create a library called
str.lib If you wish to place the object files in your own
library, insert the .obj files into your library. You may
also want to place "str.h", and "regular.h" into your default
include path. Bcstr.h is provided for those who wish to use
the Borland object-based container classes to store str's.
If you are using Turbo C++ instead of Borland C++, edit the
makefile and substitute "TCC" for "BCC".
Unix, Vax-Vms, and some other systems may also need to add
strcmp.obj to the library. This module defines non-ansi string
routines used by str class. Add this to your library if your
system does not have these (stricmp, strnicmp, strupr, strlwr).
GREP
----
Type "make grep" to create the executable for grep.
Grep is included as a demonstration program for the str class.
It supports searching of literal and regular expression
within files. Wildcard file specifications, case sensitivity,
line numbers, etc. are all supported. The implementatin uses
only around 1 page of code, which demostrates how natural coding
is when using the regular expression capabilities of the string
class.
UPGRADING
---------
If you are upgrading from version 1, then you will need to
recompile all .cpp files that use the str class. This must be
done since str.h has changed. You also will need to change
occurances of pad or strip to use the global versions. This must
be done since the member functions pad and strip now modify their
object. See section "Whats changed in 2.00".
USING
-----
You will need to include <str.h>, "str.h" in order to use class
str. If you also wish to use regular expressions include
<regX.h>, "regX.h". Header files "dynstream.h" and
"regximp.h" are strictly for implementation. and as such are
separated into other header file. You should never reference them
unless you wish to modify their implementation, or derive a new
class from them.
------------------------------------------------------------------------------
WHATS DIFFERENT ABOUT VERSION 2.0 - 2.1
---------------------------------------
WHATS DIFFERENT ABOUT VERSION 2.1
---------------------------------
Version 2.1 extends regular expression support to include context
sensitive regular expressions. See section on regular expressions
for more details.
WHATS CHANGED IN 2.02 and 2.11
------------------------------
Friend operator >> for reading in strings now directly uses the
string buffer, so as to remove the 256 character limit.
Grep now supports files in other drives and directories.
Optimizations to efficiency in str::_assign which is used
by many str member functions.
Regular expression character sets can now contain octal characters.
Fix - Member function "remove" now transfers only necessary
characters. May have caused Windows application error
previously.
WHATS CHANGED IN 2.01
---------------------
This version supports compatibility with Turbo C++. Previous
versions would fail to compile due to Turbo C++'s incorrect
handling of nested classes.
WHATS NEW IN 2.00
-----------------
1. Searching and replacing of character strings and regular